﻿using Microsoft.EntityFrameworkCore;
using Surpass.Model.SysDomain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Surpass.Repository.Repository
{
    public static partial class SeedData
    {
        public static void InitData(this ModelBuilder modelBuilder )
        {
            #region 用户

            modelBuilder.Entity<SysUser>().HasData(InitUsers);

            #endregion

            #region 角色

            modelBuilder.Entity<SysRole>().HasData(InitRoles);

            #endregion

            #region 角色用户关系

            modelBuilder.Entity<SysUserRoleRelation>().HasData(InitUserRoleRelations);

            #endregion

            #region 菜单初始数据

            modelBuilder.Entity<SysMenu>().HasData(InitMenus);

            #endregion

            #region 菜单用户关系

            modelBuilder.Entity<SysRoleMenuRelation>().HasData(InitRoleMenuRelations);

            #endregion
        }
    }
}
